#!/bin/bash
read -sp '请输入一个新的VNC远程控制密码: ' PASSWORD
echo
read -sp '请再次输入VNC远程控制密码: ' PASSWORD_B
if [[ $PASSWORD == $PASSWORD_B ]]
then 
    /usr/bin/vncpasswd -f <<<"$PASSWORD"$'\n'"$PASSWORD" > $HOME/.vnc/passwd
    echo
    echo "VNC远程控制密码已经更改"
else 
    echo
    echo "两次密码不一致，请重试"
fi
